export function Position (x, y) {
  this.x = x
  this.y = y
}

Position.prototype.copy = function (){
  return new Position(this.x, this.y)
}

Position.prototype.copyFrom = function (position) {
  this.x = position.x
  this.y = position.y
}

Position.prototype.equals = function (position) {
  return position && this.x === position.x && this.y === position.y
}

Position.convert = (value, size) => value / size

export function getRandomInt(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min)) + min; //不含最大值，含最小值
}